/**
 * 
 */
package com.kth.subtranslator.ui.controller;

import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import com.kth.subtranslator.evt.StartTranslateEvent;
import com.kth.subtranslator.ui.StatusPanel;

/**
 * @author Kevin Thackray
 *
 */
public class StatusBarController {
	
	private StatusPanel view;
	private EventBus eventBus;
	
	/**
	 * 
	 */
	public StatusBarController(EventBus eventBus) {
		this.eventBus = eventBus;
		eventBus.register(this);
	}
	
	/**
	 * @return the view
	 */
	public StatusPanel getView() {
		if (view == null) {
			view = new StatusPanel();
		}
		return view;
	}
	
	@Subscribe
	public void startLoading(StartTranslateEvent evt) {
		view.setText("Start translation");
		
	}

}
